<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>预定义常量</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="phar.resources.html">« 资源类型</a></li>
      <li style="float: right;"><a href="phar.using.html">Using Phar Archives »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.phar.html">Phar</a></li>
    <li>预定义常量</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="phar.constants" class="appendix">
 <h1>预定义常量</h1>

 <p class="simpara">下列常量由此扩展定义，且仅在此扩展编译入 PHP 或在运行时动态载入时可用。</p>
  <table id="phar.constants.compression" class="doctable table">
   <caption><strong>Phar compression constants</strong></caption>
   
    <thead>
     <tr>
      <th>Constant</th>
      <th>Value</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr id="phar.constants.none">
      <td>
       <strong><code>Phar::NONE</code></strong>
       (<span class="type">int</span>)
      </td>
      <td>0x00000000</td>
      <td>no compression</td>
     </tr>

     <tr id="phar.constants.compressed">
      <td>
       <strong><code>Phar::COMPRESSED</code></strong>
       (<span class="type">int</span>)
      </td>
      <td>0x0000F000</td>
      <td>bitmask that can be used with file flags to determine if any compression is present</td>
     </tr>

     <tr id="phar.constants.gz">
      <td>
       <strong><code>Phar::GZ</code></strong>
       (<span class="type">int</span>)
      </td>
      <td>0x00001000</td>
      <td>zlib (gzip) compression</td>
     </tr>

     <tr id="phar.constants.bz2">
      <td>
       <strong><code>Phar::BZ2</code></strong>
       (<span class="type">int</span>)
      </td>
      <td>0x00002000</td>
      <td>bzip2 compression</td>
     </tr>

    </tbody>
   
  </table>

  <table id="phar.constants.fileformat" class="doctable table">
   <caption><strong>Phar file format constants</strong></caption>
   
    <thead>
     <tr>
      <th>Constant</th>
      <th>Value</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr id="phar.constants.phar">
      <td>
       <strong><code>Phar::PHAR</code></strong>
       (<span class="type">int</span>)
      </td>
      <td>1</td>
      <td>phar file format</td>
     </tr>

     <tr id="phar.constants.tar">
      <td>
       <strong><code>Phar::TAR</code></strong>
       (<span class="type">int</span>)
      </td>
      <td>2</td>
      <td>tar file format</td>
     </tr>

     <tr id="phar.constants.zip">
      <td>
       <strong><code>Phar::ZIP</code></strong>
       (<span class="type">int</span>)
      </td>
      <td>3</td>
      <td>zip file format</td>
     </tr>

    </tbody>
   
  </table>

  <table id="phar.constants.signature" class="doctable table">
   <caption><strong>Phar signature constants</strong></caption>
   
    <thead>
     <tr>
      <th>Constant</th>
      <th>Value</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr id="phar.constants.md5">
      <td>
       <strong><code>Phar::MD5</code></strong>
       (<span class="type">int</span>)
      </td>
      <td>0x0001</td>
      <td>signature with md5 hash algorithm</td>
     </tr>

     <tr id="phar.constants.sha1">
      <td>
       <strong><code>Phar::SHA1</code></strong>
       (<span class="type">int</span>)
      </td>
      <td>0x0002</td>
      <td>signature with sha1 hash algorithm</td>
     </tr>

     <tr id="phar.constants.sha256">
      <td>
       <strong><code>Phar::SHA256</code></strong>
       (<span class="type">int</span>)
      </td>
      <td>0x0003</td>
      <td>signature with sha256 hash algorithm (requires hash extension)</td>
     </tr>

     <tr id="phar.constants.sha512">
      <td>
       <strong><code>Phar::SHA512</code></strong>
       (<span class="type">int</span>)
      </td>
      <td>0x0004</td>
      <td>signature with sha512 hash algorithm (requires hash extension)</td>
     </tr>

     <tr id="phar.constants.openssl">
      <td>
       <strong><code>Phar::OPENSSL</code></strong>
       (<span class="type">int</span>)
      </td>
      <td>0x0010</td>
      <td>signature with OpenSSL public/private key pair.  This is a true,
      asymmetric key signature.</td>
     </tr>

    </tbody>
   
  </table>

  <table id="phar.constants.mimeoverride" class="doctable table">
   <caption><strong>Phar webPhar mime override constants</strong></caption>
   
    <thead>
     <tr>
      <th>Constant</th>
      <th>Value</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr id="phar.constants.php">
      <td>
       <strong><code>Phar::PHP</code></strong>
       (<span class="type">int</span>)
      </td>
      <td>0</td>
      <td>used to instruct the mimeoverrides parameter
      of <span class="function"><a href="phar.webphar.html" class="function">Phar::webPhar()</a></span> that the extension should be
      parsed as a PHP file</td>
     </tr>

     <tr id="phar.constants.phps">
      <td>
       <strong><code>Phar::PHPS</code></strong>
       (<span class="type">int</span>)
      </td>
      <td>1</td>
      <td>used to instruct the mimeoverrides parameter
      of <span class="function"><a href="phar.webphar.html" class="function">Phar::webPhar()</a></span> that the extension should be
      parsed as a PHP source file through <span class="function"><a href="function.highlight-file.html" class="function">highlight_file()</a></span></td>
     </tr>

    </tbody>
   
  </table>

</div>
</div></div></body></html>